$(document).ready(function() {
	
	Invitesq.postTimelineTemplate = function(){
		return '' +
			'<article class="comment">' +
				'<a class="comment-img" href="#non">' +
				'<img src="http://lorempixum.com/50/50/people/7" alt="" width="50" height="50">' +
				'</a>' +
				'<div class="comment-body">' +
					'<div class="text">' +
					  '<p><%= post %></p>' +
					'</div>' +
				'<p class="attribution"><a href="#non"><%= author %></a> at <%= created_time %> </p>' +
				'</div>' +
			'</article>' ;
	
	}
	
	Invitesq.PostModel = Backbone.Model.extend({
		defaults: {
		    "author":  "anonymous",
		  }
	});

	Invitesq.PostCollection = Backbone.Collection.extend({});

	Invitesq.PostView = Backbone.View.extend({
		tagName : "section",
		
		className: "comments",
		
		template : _.template(Invitesq.postTimelineTemplate()),
		
		initialize : function() {
			_.bindAll(this, 'render');
			this.model.bind('change', this.render, this);
		},
		events : {
			
		},

		render : function() {
			//console.log(this.model.toJSON());
			$(this.el).html(this.template(this.model.toJSON()));
			return this;
		}
	});
}); 